/* 
 * Author: anand
 * 
 */

#ifndef _PLAYLIST_H
#define	_PLAYLIST_H

#include "playlist_item.h"
#include "dbhelper.h"
#include "playlist_items.h"
#include "path_util.h"
#include <ctime>
#include <string>

class 
#ifdef _MSC_VER 		//using this so I dont have to create a .def file for implib gen  
__declspec(dllexport)
#endif
playlist {
public:
    playlist();
    void add_item(playlist_item *item);
    void add_item(char *path_, int position);
    void remove_item(playlist_item *item);
    void universal_remove_item(playlist_item *item);
    void delete_item(playlist_item *item);
    std::string next_item();
    std::string prev_item();
    std::string current_item();
	void show_current_playlist();

    void raw_execute(const char *sql);
	result_set * get_row_map(const char *sql);
    void show_available_playlists();
    ~playlist();
private:
	int _id;
	std::string _name;
	time_t _lastactivets;
	bool _isNew;
    int _current;
    playlist_items *_playlist_items;
    dbhelper *_dbHelper;
    std::map<std::string,std::string> _properties;
    void save();
};


#endif	/* _PLAYLIST_H */

